![]() |
SeedCFill |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Determines how far filling will extend to pixels matching the color of a particular pixel.
void SeedCFill ( const BitMap *srcBits, const BitMap *dstBits, const Rect *srcRect, const Rect *dstRect, SInt16 seedH, SInt16 seedV, ColorSearchUPP matchProc, SInt32 matchData );
The source image. If the image is in a pixel map, you must coerce its PixMap structure to a BitMap structure.
On return, the destination mask.
The rectangle of the source image.
The rectangle of the destination image.
The horizontal position of the seed point.
The vertical position of the seed point.
An optional color search function.
Data for the optional color search function.
The SeedCFill function generates a mask showing where the pixels in an image can be filled from a starting point, like the paint pouring from the MacPaint paint-bucket tool. This mask is a bitmap filled with 1’s to indicate all pixels adjacent to a seed point whose colors do not exactly match the RGBColor structure for the pixel at the seed point. You can then use this mask with the CopyBits, CopyMask, and CopyDeepMask functions.
You specify a source image in the srcBits parameter and, in the srcRect parameter, specify a rectangle within that source image. You specify where to begin seeding in the seedH and seedV parameters, which must be the horizontal and vertical coordinates of a point in the local coordinate system of the source bitmap. By default, the 1’s returned in the mask indicate all pixels adjacent to the seed point whose pixel values do not exactly match the pixel value of the pixel at the seed point. To use this default, set the matchProc and matchData parameters to 0.
In generating the mask, SeedCFill uses the CopyBits function to convert the source image to a 1-bit mask. The SeedCFill function installs a default color search function that returns 0 if the pixel value matches that of the seed point; all other pixel values return 1’s.
The SeedCFill function does not scale so the source and destination rectangles must be the same size. Calls to SeedCFill are not clipped to the current port and are not stored into QuickDraw pictures.
To customize SeedCFill, write your own color search function and point to it in the matchProc parameter; SeedCFill will then use your function instead of the default.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)